<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const s1 = new Set();
        console.log(s1.size);
        const s2 = new Set([1,5,6,4,2,1,2]);
        console.log(s2.size);
        
        //数组去重
        console.log([...s2]);   
        console.log(Array.from(s2));
    </script>
</body>

</html>